import { useNavigation } from '@react-navigation/native';

const useHeaderBar = () => {
  const navigation = useNavigation();
  const handleClickHeaderBack = () => {
    setTimeout(() => {
      if (navigation.canGoBack()) {
        navigation.goBack();
      }
    });
  };

  return { handleClickHeaderBack };
};

export default useHeaderBar;
